HOW TO WRITE A HOOK